﻿using System.Globalization;
using System.Threading;
using Microsoft.Extensions.Configuration;

namespace Dora.Core.System
{
    /// <summary>
    /// 项目的自定义配置类
    /// </summary>
    public static class OurCustomExtension
    {
        //加载个性化项目
        public static IConfigurationBuilder LoadPersonalizedSettings(this IConfigurationBuilder config)
        {
            CultureInfo i;
            i = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
            i.DateTimeFormat.LongTimePattern = "HH:mm:ss";
            i.DateTimeFormat.ShortTimePattern = "HH:mm";
            i.DateTimeFormat.LongDatePattern = "yyyy-MM-dd";
            i.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd";
            i.DateTimeFormat.FullDateTimePattern = "yyyy-MM-dd HH:mm:ss zzz";
            Thread.CurrentThread.CurrentCulture = i;
            return config;

        }

    }
}
